<#--  只有UI变动，无逻辑改动  -->
<#assign ctrl_base_name = "TreeExpBarControlBase"/>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>

    /**
     * 控件宽度
     *
     * @type {number}
     * @memberof ${srfclassname('${ctrl.codeName}')}Base
     */
    public ctrlWidth:number = <#if ctrl.getWidth()??>${ctrl.getWidth()}<#else>0</#if>;

    /**
     * 获取关系项视图
     *
     * @param {*} [arg={}]
     * @returns {*}
     * @memberof ${srfclassname('${ctrl.codeName}')}Base
     */
    public getExpItemView(arg: any = {}): any {
        let expmode = arg.nodetype.toUpperCase();
        if (!expmode) {
            expmode = '';
        }
        <#list ctrl.getPSAppViewRefs() as item>
        <#if (item.getName()?index_of("EXPITEM:")==0)>
        <#assign refview = item.getRefPSAppView()>
        if (Object.is(expmode, '${item.getName()?substring(8)?upper_case}')) {
            return {  
                viewname: '${srffilepath2(refview.codeName)}', 
                parentdata: <#if item.getParentDataJO()??>${item.getParentDataJO()},<#else>{},</#if>
          <#if refview.getPSAppDataEntity?? && refview.getPSAppDataEntity()??>
                deKeyField:'${refview.getPSAppDataEntity().codeName?lower_case}'
          </#if>      
			};
        }
        </#if>
        </#list>
        return null;
    }

    /**
    * 执行mounted后的逻辑
    *
    * @memberof ${srfclassname('${ctrl.codeName}')}Base
    */
    public ctrlMounted(){ 
        if(this.$store.getters.getViewSplit(this.viewUID)){
            this.split = this.$store.getters.getViewSplit(this.viewUID);
        }else{
            let containerWidth:number = (document.getElementById("${ctrl.getCodeName()?lower_case}") as any).offsetWidth;
            if(this.ctrlWidth){
                    this.split = this.ctrlWidth/containerWidth;
            }
            this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split}); 
        }  
    }

    /**
     * 视图数据加载完成
     *
     * @param {*} $event
     * @memberof ${srfclassname('${ctrl.codeName}')}Base
     */
    public onViewLoad($event: any): void {
        this.$emit('load', $event);
    }
    <#if ctrl.getPSControls()??>
    <#assign controls = ctrl.getPSControls()/>
    <#list controls as singleControl>
    <#if singleControl.getControlType() == "TOOLBAR">

    ${P.getCtrlCode(singleControl, 'CONTROL.vue').code}
    </#if>
    </#list>
    </#if>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>